// 请求模块
import axios from 'axios'
// import store from '@/store/index'
import { getItem } from './storage'
const request = axios.create({
  baseURL: 'http://127.0.0.1:8888/api/private/v1/'
})
request.interceptors.request.use((config) => {
  console.log(config)
  /* const { user } = store.state
  if (user && user.token) {
    config.headers.Authorization = user
  } */
  config.headers.Authorization = getItem('token')

  return config
})
export default request
